home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / networking / appletalk / uab.shar / proto_intf.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-07-12  |  2.2 KB  |  67 lines

  1. /*
  2.  * $Author: cck $ $Date: 88/09/14 10:20:15 $
  3.  * $Header: /src/local/mac/cap/etalk/RCS/proto_intf.h,v 1.3 88/09/14 10:20:15 cck Rel $
  4.  * $Revision: 1.3 $
  5. */
  6.  
  7. /*
  8.  * protocol interface header:
  9.  *
  10.  *  Provides ability to read/write packets at ethernet level
  11.  *
  12.  *
  13.  * Copyright (c) 1988 by The Trustees of Columbia University 
  14.  *  in the City of New York.
  15.  *
  16.  * Permission is granted to any individual or institution to use,
  17.  * copy, or redistribute this software so long as it is not sold for
  18.  * profit, provided that this notice and the original copyright
  19.  * notices are retained.  Columbia University nor the author make no
  20.  * representations about the suitability of this software for any
  21.  * purpose.  It is provided "as is" without express or implied
  22.  * warranty.
  23.  *
  24.  *
  25.  * Edit History:
  26.  *
  27.  *  August 1988  CCKim Created
  28.  *
  29. */
  30.  
  31. /* call first (double call okay) */
  32. export int pi_setup();
  33. /* call with protocol (network order), device name (e.g. qe), device */
  34. /* unit number, return < 0 on error, > 0 protocol handle */
  35. export int pi_open(/* int protocol, char * dev, int devno */);
  36. /* get ethernet address, ea is pointer to place to return address */
  37. export int pi_get_ethernet_address(/* int edx, u_char *ea */);
  38. /* returns TRUE if interface tap can see its own broadcasts (or they */
  39. /* are delivered by system */
  40. export int pi_delivers_self_broadcasts();
  41. /* close a protocol handle */
  42. export int pi_close(/* int edx */);
  43. /* establishes a listener to be called when data ready on */
  44. /* protocol,interface.  (*listener)(socket, arg, eh) */
  45. export int pi_listener(/* int edx, int (*listener), caddr_t arg */);
  46. /* like read */
  47. export int pi_read(/* int edx, caddr_t buf, int bufsize */);
  48. /* like readv */
  49. export int pi_readv(/* int edx, struct iovec iov[], int iovlen */ );
  50. /* like write */
  51. export int pi_write(/* int idx, caddr_t buf, int bufsize */);
  52. /* like writev */
  53. export int pi_writev(/* int edx, struct iovec iov[], int iovlen */ );
  54.  
  55. #define EHRD 6            /* ethernet hardware address length */
  56.  
  57. /* much like struct ether_header, but we know what is here -- can be */
  58. /* variable on systems */
  59. struct ethernet_addresses {
  60.   u_char daddr[EHRD];
  61.   u_char saddr[EHRD];
  62.   u_short etype;
  63. };
  64.  
  65. #define MAXOPENPROT 10        /* arb. number */
  66.  
  67.